package day04.homework;
//4. 输出1900到2023年之间所有的闰年(每够10个年份，换一行)
public class Answer3 {
    public static void main(String[] args) {
        int start=1900;
        int end=2023;
        getYear(start,end);

    }
    private static void getYear(int start, int end) {
        int count=0;
        for (int i = start; i <=end ; i++) {
            if (i%4==0&&i%100!=0||i%400==0){
                count++;
                if (count%10==0){
                    System.out.println(i+" ");
                }else {
                    System.out.print(i+" ");
                }
            }
        }
    }
}
